<?php

    class Sitem extends CI_Model{

        function __construct(){
            parent::__construct();
        }

        function read($page='',$sub='',$upsub=''){

            $row = $this->db->get_where('text',array('page'=>$page,'sub'=>$sub,'upsub'=>$upsub,'lang'=>$this->lang_ses->getLang()))->row();

            /*
            * If no data
            * create new object with message
            */ 
            
            if(count($row)==0){   

                $instance = new newRow($this->lang->line('nodata'));
                $row = $instance;     

            }

            return $row;
        }

    }

    class newRow
    {
        public $title = '';
        public $text = '';
        
         function __construct($txt){
            $this->title = $txt;
        }
    }

?>
